// ========================================================================================
// Name:	Pool.h
//	
// Author:	Onyebuchi Ekenta
//
// Purpose: An instance class is used as a method to define the boundaries of a contiguous
//			field of water. Each field must be rectangular. These rectangles are given
//			to CellParitition so characters can no if they are walking on water. 
// ========================================================================================


#ifndef POOL_H
#define POOL_H

#include "General Structures.hpp"
#include "Vector2D.h"

class Pool
{
private:
	// The boundaries of the pool.
	GameRectangle m_Boundaries;
	bool CanMerge( const Pool& pool);

	// Specifies if the given pool is a pool with a side coinciding with 
	// this pool's top/bottom/left/right

	bool CanMergeFromTop(const Pool& pool);
	bool CanMergeFromBottom(const Pool& pool);
	bool CanMergeFromLeft(const Pool& pool);
	bool CanMergeFromRight(const Pool& pool);

public:
	Pool();
	Pool(GameRectangle rect);

	bool Merge(const Pool& pool);

	bool IntersectsPool(GameRectangle rect);
	void RenderBox();
	Vector2D Location();
};

#endif